package com.lmt.feign;

import com.lmt.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * Date 2018/06/28
 *
 * @author MT-Lin
 */
@FeignClient(name = "provider")
public interface ProviderFeignClient {

    @RequestMapping(value = "/findUserById", method = RequestMethod.GET)
    User findUserById(@RequestParam(name = "id") String id);

    @RequestMapping(value = "/getUserByRequestParam", method = RequestMethod.GET)
    User getUserByRequestParam(@RequestParam("id") String id, @RequestParam("username") String username);

    @RequestMapping(value = "/getUserByMap", method = RequestMethod.GET)
    User getUserByMap(@RequestParam Map<String, Object> map);

    @RequestMapping(value = "/getUserByEntity", method = RequestMethod.POST)
    User getUserByEntity(@RequestBody User user);
}
